<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>循环的使用</title>

    <link rel="stylesheet" href="../plugins/bootstrap/css/bootstrap.min.css"/>
</head>
<body ng-app = "myapp" ng-controller="myctrl">

    <table class="table table-bordered">
        <tr>
            <th>下标</th>
            <th>姓名</th>
            <th>学号</th>
            <th>语文成绩</th>
        </tr>
        <tr ng-repeat="stu in list">
            <td>{{$index + 1}}</td>
            <td>{{stu.name}}</td>
            <td>{{stu.shuxue}}</td>
            <td>{{stu.yuwen}}</td>
        </tr>
    </table>
</body>

<!-- 导入js -->
<script src="../plugins/angularjs/angular.min.js"></script>
<script type="text/javascript">
    var myapp = angular.module("myapp", []);
    myapp.controller("myctrl", function ($scope) {
        $scope.list = [
            {name:'张三',shuxue:100,yuwen:93},
            {name:'李四',shuxue:88,yuwen:87},
            {name:'王五',shuxue:77,yuwen:56}];
    });

</script>
</html>